<?php
$sql="select * from sl_gab order by nazwa";
$result=mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$lek_bad[$row[0]]=$row;
}
echo '<table>';
foreach ($lek_bad as $i => $w){
	echo '<tr><td class="linia">';
	echo $w[1];
	echo '</td><td>';
	echo '<form action="index.php" method="POST"><input type=hidden name=ed_lek_bad value='.$i.'><input type=submit value=Edycja class="butt"></form>';
	echo '</tr>';
}
echo '</table>';
	?>